from flask import Flask
import mysql.connector

app = Flask(__name__)

@app.route('/')
def hello():
    conn = mysql.connector.connect(
        user='user',
        password='password',
        host='mysql',
        database='mydb'
    )
    cursor = conn.cursor()
    cursor.execute("SELECT VERSION()")
    version = cursor.fetchone()[0]
    cursor.close()
    conn.close()
    return f"MySQL Version: {version}"

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000)